package ch07.shili.dao.sysUser.impl;

import ch07.shili.dao.sysUser.SysUserMapper;
import ch07.shili.pojo.SysUser;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.support.SqlSessionDaoSupport;

import java.util.List;

/**
 * @author 崔书健
 * @date 2024/7/19
 */
public class SysUserMapperImpl extends SqlSessionDaoSupport implements SysUserMapper {

//    private SqlSessionTemplate sqlSession;
    @Override
    public List<SysUser> selectSysUserList(SysUser sysUser) {
//        return sqlSession.selectList("ch07.shili.dao.sysUser.SysUserMapper.selectSysUserList",sysUser);
        return this.getSqlSession().selectList("ch07.shili.dao.sysUser.SysUserMapper.selectSysUserList",sysUser);
    }

    /**
     * 保存用户
     *
     * @param sysUser
     * @return
     */
    @Override
    public int add(SysUser sysUser) {
        return this.getSqlSession().insert("ch07.shili.dao.sysUser.SysUserMapper.add",sysUser);
    }


//    public SqlSessionTemplate getSqlSession(){
//        return sqlSession;
//    }

//    public void setSqlSession(SqlSessionTemplate sqlSession){
//        this.sqlSession = sqlSession;
//    }
}
